package chartor;

public class Jingdutiao {
	private float jindu;
	private final float maxjindu=1000;
	private int speed;
	private boolean isOk;//能装弹
	private Gun gun;
Jingdutiao(int speed,Gun gun){
	this.jindu=0;
	this.speed=speed;
	this.gun=gun;
	this.isOk=false;
}
public void start() {
	this.jindu=this.maxjindu;
	setOk(true);
}
public void move() {
	if(jindu>0)
	jindu-=speed;
	else if(isOk&&jindu<=0){
		gun.load();
		setOk(false);
	}
}
public float getJindu() {
	return jindu;
}
public float getMaxjindu() {
	return maxjindu;
}
public void setJindu(float jindu) {
	this.jindu = jindu;
}
public boolean isOk() {
	return isOk;
}
public void setOk(boolean isOk) {
	this.isOk = isOk;
}
}
